package cn.zlx.elasticsearch.entities;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

/**
 * @ClassName User
 * @Description TODO
 * @Author Edward
 * @Date 2020/12/19 22:36
 */
@Mapping(mappingPath = "elasticsearch_mapping.json")//设置mapping
@Setting(settingPath = "elasticsearch_setting.json")//设置setting
@Document(indexName = "user",type = "_doc")
public class User {
    @Id
    private Long id;

    @Field(type = FieldType.Keyword)
    private String firstCode;

    @Field(type = FieldType.Keyword)
    private String secordCode;

    @Field(type = FieldType.Text, analyzer = "pinyin_analyzer",searchAnalyzer = "ik_max_word")
    private String content;

    @Field(type = FieldType.Integer)
    private Integer type;

    public User()
    {

    }
    public Long getId()
    {
        return id;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public String getFirstCode()
    {
        return firstCode;
    }

    public void setFirstCode(String firstCode)
    {
        this.firstCode = firstCode;
    }

    public String getSecordCode()
    {
        return secordCode;
    }

    public void setSecordCode(String secordCode)
    {
        this.secordCode = secordCode;
    }

    public String getContent()
    {
        return content;
    }

    public void setContent(String content)
    {
        this.content = content;
    }

    public Integer getType()
    {
        return type;
    }

    public void setType(Integer type)
    {
        this.type = type;
    }

    public User(Long id, String firstCode, String secordCode, String content, Integer type)
    {
        this.id = id;
        this.firstCode = firstCode;
        this.secordCode = secordCode;
        this.content = content;
        this.type = type;
    }

}
